package com.xxl.job.core.executor.impl;

import com.xxl.job.core.executor.XxlJobExecutor;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.noear.solon.core.BeanExtractor;
import org.noear.solon.core.BeanWrap;
import org.noear.solon.core.bean.LifecycleBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.lang.reflect.Method;


/**
 * xxl-job executor (for spring)
 *
 * @author xuxueli 2018-11-01 09:24:52
 */
public class XxlJobSolonExecutor extends XxlJobExecutor implements LifecycleBean, BeanExtractor<XxlJob> {

    public static XxlJobSolonExecutor instance = new XxlJobSolonExecutor();

    private static final Logger logger = LoggerFactory.getLogger(XxlJobSolonExecutor.class);

    @Override
    public void doExtract(BeanWrap bw, Method method, XxlJob anno) throws Throwable {
        registJobHandler(anno, bw, method);
    }
}
